# RT-Thread building script for component

from building import *

src     = []
cwd     = GetCurrentDir()
CPPPATH = [cwd]
group   = []

flag = False
src += ['unistd.c'] #TODO

if GetDepend('RT_USING_POSIX_DEVIO'):
    src += ['libc.c']
    flag = True

if GetDepend('RT_USING_POSIX_DELAY'):
    src += ['delay.c']
    flag = True

if GetDepend('RT_USING_POSIX_POLL'):
    src += ['poll.c']
    flag = True

if GetDepend('RT_USING_POSIX_SELECT'):
    src += ['select.c']
    flag = True

if GetDepend('RT_USING_POSIX_MMAP'):
    src += ['mmap.c']
    flag = True

if flag == True:
    group = DefineGroup('POSIX', src, depend = [], CPPPATH = CPPPATH)

Return('group')
